-
Notifications
You must be signed in to change notification settings - Fork 8.2k
boards: stm32h7s78_dk: Introduce App in Ext Flash variant #97992
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
boards: stm32h7s78_dk: Introduce App in Ext Flash variant #97992
Conversation
|
The following west manifest projects have changed revision in this Pull Request:
✅ All manifest checks OK Note: This message is automatically posted and updated by the Manifest GitHub Action. |
dae3619 to
1ddea9e
Compare
1ddea9e to
8251c15
Compare
| compatible = "soc-nv-flash"; | ||
| reg = <0x0 DT_SIZE_M(128)>; | ||
| write-block-size = <1>; | ||
| erase-block-size = <DT_SIZE_K(128)>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| erase-block-size = <DT_SIZE_K(128)>; | |
| erase-block-size = <DT_SIZE_K(4)>; |
lowest as possible, see #97037 (comment)
| choice MCUBOOT_MODE | ||
| default MCUBOOT_MODE_DIRECT_XIP | ||
| endchoice |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also use MCUBOOT_MODE_SWAP_USING_OFFSET like in #97037 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For some reason, MCUBOOT_MODE_SWAP_USING_OFFSET prevents building mcuboot image as it has an impact on following parameters (build/stm32h7s78_dk/stm32h7s7xx/ext_app_flash/mcubootCMakeCache.txt)
//Estimated MCUboot image trailer size
mcuboot_image_footer_size:INTERNAL=32808
//Estimated MCUboot update image trailer size
mcuboot_image_upgrade_footer_size:INTERNAL=32768
vs (SINGLE_APP_MODE & DIRECT_XIP)
//Estimated MCUboot image trailer size
mcuboot_image_footer_size:INTERNAL=88
//Estimated MCUboot update image trailer size
mcuboot_image_upgrade_footer_size:INTERNAL=48
As a consequence, this doesn't fit available RAM anymore.
Note that it is the same on stm32h750_dk because it can afford it:
Memory region Used Size Region Size %age Used
FLASH: 34568 B 128 KB 26.37%
RAM: 138304 B 512 KB 26.38%
but also trailers size are lower:
//Estimated MCUboot image trailer size
mcuboot_image_footer_size:INTERNAL=16424
//Estimated MCUboot update image trailer size
mcuboot_image_upgrade_footer_size:INTERNAL=16384
(Anyway, in any case, this wouldn't fit on stm32h7s78_dk which has only 128k of RAM)
I'll go for SINGLE_APP_MODE for now, but there is probably something to investigate here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ammount of sectors in slot0 and slot1 has a direct influence in mcuboot size, as it uses that for the size of an array. would propably work, if we make the flash driver respect the value from the dt prop erase-block-size, so it can be used to increase it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but that's for later
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are other MCUboot tests the board can be added to (see the H750B-DK PR).
| reg = <0x70000000 DT_SIZE_M(64)>; | ||
| zephyr,memory-region = "EXTMEM"; | ||
| /* The ATTR_MPU_EXTMEM attribut causing a MPU FAULT */ | ||
| zephyr,memory-attr = <DT_MEM_ARM(ATTR_MPU_IO)>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you test samples/modules/lvgl/demos? On H750B-DK, it didn't work with MPU_IO (but worked with MPU_FLASH). On H573I-DK it did work (& with MPU_FLASH the board didn't boot), not sure why yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Display related features are not working yet when executed from external flash. Probably due to STM32_LTDC_FB_USE_SHARED_MULTI_HEAP, had no time to investigate this (likely related to use of multiple XSPI instances used in //)
Is everyone fine to put this as a notable issue that can still be investigated and fixed in RC ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Display related features are not working yet
Weird, even samples/drivers/display?
Non-blocking, but could you try with MPU_FLASH attribute?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is everyone fine to put this as a notable issue that can still be investigated and fixed in RC ?
Makes sense.
34a08eb to
4c675de
Compare
west.yml
Outdated
| url-base: https://github.com/zephyrproject-rtos | ||
| - name: babblesim | ||
| url-base: https://github.com/BabbleSim | ||
| - name: mcuboot_upstream |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
needs to use proper commit for this, ping me when one is needed and will prepare it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nordicjm Don't you need to approve & merge mcu-tools/mcuboot#2510 first ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm github does not seem to be working for me using git right now, will have a look later and see if it starts working
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems it does eventually work, use the commit from here: https://github.com/nordicjm/zephyr/tree/somemcubootupdatecommits
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, let me know if this is correct.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm no, cherry pick the commit above and replace your commit with it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nordicjm Hope it is fine now
| endchoice | ||
|
|
||
| choice MCUBOOT_MODE | ||
| default MCUBOOT_MODE_SINGLE_APP |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this can use direct-xip if wanted, there is no limitation on mode that can be used
Update Zephyr fork of MCUboot to revision:
96576b341ee19f1c3af6622256b0d4f3d408e1e3
Brings following Zephyr relevant fixes:
- 96576b34 boot: zephyr: socs: stm32h7s7xx: Add support for
ext_flash_app variant
- 56538cf6 bootutil: Move update-independent code
- fccd8905 loader: Move boot_get_max_app_size(..) API
- 0248a023 bootutil: Move state-independent area APIs
- f2d3f00a loader: Unify image check API.
- dcc66e51 loader: Unify header_valid(..) API
- 257265c8 loader: Optimize boot_check_header_erased(..)
- 76e56e4f loader: Rename boot_version_cmp
- 5311589b loader: Fix compile-time issues in loader.c
- 606a1934 boot: zephyr: socs: add overlay & conf for
stm32h573xx_ext_flash_app
- 521fc0bf bootutil: Conditionally include mbedtls/ oid.h,
asn1.h
- 71b41e38 boot: zephyr: boards: remove nrf54h20dk overlay
- 2fc1bd84 bootutil: Drop slot number and boot_state from most
boot_enc functions
- 1dd8ae60 boot: zephyr: rework stm32h750b_dk board overlay &
conf
Signed-off-by: Jamie McCrae <[email protected]>
4c675de to
0669808
Compare
Add ext_flash_app variant to stm32h7s78_dk to allow building application running on ext flash. Largely based on A.Jarmouni's work to enable the same on stm32h750_dk in PR 97037. Signed-off-by: Erwan Gouriou <[email protected]>
…iant Now that ext_flash_app variant is available, it should be used for mcuboot related apps on this board. Signed-off-by: Erwan Gouriou <[email protected]>
Add debug using stlink gdbserver as an alternative to pyocd. Signed-off-by: Erwan Gouriou <[email protected]>
Actual available internal RAM size was wrong, fix it. Signed-off-by: Erwan Gouriou <[email protected]>
0669808 to
1e20348
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|



Based on #97037
Similarly to what is done for
stm32h750_dkboard in #97037, introduce aext_flash_appboard variant aiming at being chainloaded by MCUBoot.Requires mcuboot counter part (mcu-tools/mcuboot#2510) to allow MCUBoot to run on internal flash.
Doc not provided, waiting for #97037 to be merged.
@JarmouniA, in a fisrst step, I plan to redirect doc to
stm32h750_dkto avoid redundant doc in each board.